/** 
 * 编码标识
 * <pre>
 *  +--------------------------------------------------
 *  |200   	成功标识
 *  +--------------------------------------------------
 *  |5XXYY 	系统级标识
 *  +--------------------------------------------------
 *  |6XXYY 	服务级标识
 *  +--------------------------------------------------
 * </pre>
 * <pre>
 *  +--------------------------------------------------
 *  |50001 	系统级标识	系统错误	
 *  |按顺序编号
 *  +--------------------------------------------------
 *  |60101 	服务级标识	非法请求
 *  |6(第一位)：服务标识；
 *  |01(第二、三位)：模块标识；
 *  |01(第四、五位)：具体错误代码
 *  +--------------------------------------------------
 * </pre>
 */ 

package org.ecloud.common.constants;

/** 
 * 编码标识
 */
public enum StateEnum {

	SUCCESS(200, "请求成功")
	
	, UNAVAILABLE_GATEWAY(50001, "网关超时")
	, UNAVAILABLE_SERVICE(50002, "服务不可用")
	
	, ILLEGAL_REQUEST(6010101, "非法请求")
	, ILLEGAL_IP(6010102, "IP被禁止")
	
	, ILLEGAL_CLIENT_ID_SECRET(6020101, "授权ID或密钥错误")
	, ILLEGAL_AUTHORIZE_CODE(6020102, "授权码错误")
	, ILLEGAL_LOGIN_STATE(6020103, "未登录")
	, ILLEGAL_LOGIN(6020104, "登录异常")
	, ILLEGAL_VALID_CODE(6020105, "验证码错误")
	, ILLEGAL_ACCOUNT_PASSWORD(6020106, "用户名或密码错误")
	, ILLEGAL_ACCOUNT_INACTIVE(6020107, "用户未激活")
	, ILLEGAL_ACCOUNT_EXPIRED(6020108, "用户过期")
	, ILLEGAL_ACCOUNT_EXPIRED_CREDENTIALS(6020109, "密码过期")
	, ILLEGAL_ACCOUNT_DISABLED(6020110, "用户被禁用")
	, ILLEGAL_ACCOUNT_LOCKED(6020111, "用户被锁定")
	, ILLEGAL_ACCOUNT_UNKOWN(6020112, "未知账号")
	, ILLEGAL_ORG_UNKOWN(6020113, "未知部门")
	, ILLEGAL_POSITION_UNKOWN(6020114, "未知岗位")
	
	, ILLEGAL_TOKEN(6020201, "非法token")
	, ILLEGAL_GRANT_TYPE(6020202, "授权类型不支持")
	;
	
	private int code;
	private String text;
	
	private StateEnum(int code){
		this.code = code;
		this.text = ""+code;
	}
	
	private StateEnum(int code, String text){
		this.code = code;
		this.text = text;
	}
	
	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}
	
}
